<?php

namespace App\Models\User\Repositories\Interfaces;

use App\Models\User\WechatMiniAppUser;

interface WechatMiniAppUserRepositoryInterface
{
    public function addData(array $data): WechatMiniAppUser;

    public function updateData(WechatMiniAppUser $appUser, array $data): bool;

    public function findByOpenId(string $openid): ?WechatMiniAppUser;

    /**
     * 可能一个user 对应多个app_id 此处兼容
     * @param string $user_id
     * @param string $appid
     * @return WechatMiniAppUser|null
     */
    public function findByAppIdAndUserId(string $user_id, string $appid = ''): ?WechatMiniAppUser;
}